package com.ruoyi.system.repository.service.impl;

import java.util.List;

import com.ruoyi.system.repository.domain.User;
import com.ruoyi.system.repository.mapper.UserMapper;
import com.ruoyi.system.repository.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 会员Service业务层处理
 *
 * @author qiang
 * @date 2021-01-01
 */
@Service
public class UserServiceImpl implements IUserService {
    @Autowired
    private UserMapper userMapper;

    /**
     * 查询会员
     *
     * @param phone 会员ID
     * @return 会员
     */
    @Override
    public User selectUserById(String phone) {
        return userMapper.selectUserById(phone);
    }

    /**
     * 查询会员列表
     *
     * @param user 会员
     * @return 会员
     */
    @Override
    public List<User> selectUserList(User user) {
        return userMapper.selectUserList(user);
    }

    /**
     * 新增会员
     *
     * @param user 会员
     * @return 结果
     */
    @Override
    public int insertUser(User user) {
                                                                                                                                        return userMapper.insertUser(user);
    }

    /**
     * 修改会员
     *
     * @param user 会员
     * @return 结果
     */
    @Override
    public int updateUser(User user) {
                                                                                                                                        return userMapper.updateUser(user);
    }

    /**
     * 批量删除会员
     *
     * @param phones 需要删除的会员ID
     * @return 结果
     */
    @Override
    public int deleteUserByIds(String[] phones) {
        return userMapper.deleteUserByIds(phones);
    }

    /**
     * 删除会员信息
     *
     * @param phone 会员ID
     * @return 结果
     */
    @Override
    public int deleteUserById(String phone) {
        return userMapper.deleteUserById(phone);
    }
}
